package net.sx.minemodule.mvp.presenters;

import com.kedll.library.mvp.AbstractRefreshPresenter;
import com.kedll.library.mvp.RefreshingView;

import net.sx.minemodule.MineApiUtils;
import net.sx.minemodule.mvp.bean.PackageInfoBean;

import io.reactivex.Observable;

/**
 * @author 11470
 */
public class MinePackageInfoPresenter extends AbstractRefreshPresenter<RefreshingView> {

    public MinePackageInfoPresenter(RefreshingView mView) {
        super(mView);
    }

    @Override
    protected void fetchData(boolean isLoadMore) {
        MineApiUtils.getwithDrawList("", jsonObject -> {
        //TODO
        }, throwable -> {

        });
//
//        //在这里创建数据
//        addSubscription(Observable.range(0, 5)
//                .map(integer -> {
//                    PackageInfoBean bean = new PackageInfoBean();
//                    int num = 2;
//                    if (integer % num == 0) {
//                        bean.setType("充值");
//                        bean.setMoney("+100");
//                    } else {
//                        bean.setType("消费");
//                        bean.setMoney("-100");
//                    }
//
//                    bean.setBalance("10000");
//                    bean.setDate("2018-11-1 14:00");
//
//                    return bean;
//                })
//                .toList()
//                .subscribe(bean -> parserData(isLoadMore, bean)));
    }
}
